home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / CHyperText 1.2 / CHyperText Folder / CHyperText.h < prev   
Encoding:
C/C++ Source or Header  |  1994-11-30  |  2.7 KB  |  102 lines  |  [TEXT/KAHL]

  1. /******************************************************************************
  2.  CHyperText.cp
  3.  
  4.         
  5.     SUPERCLASS = CStyleText
  6.     
  7.     Copyright © 1994 Johns Hopkins University. All rights reserved.
  8.     
  9.     Original Author:     Martin R. Wachter        email:    mrw@welchgate.welch.jhu.edu
  10.     Created:            4/4/94                    by:        mrw            TCL Version:    1.1.3
  11.     Modified:            4/5/94                    by:        mrw            TCL Version:    1.1.3
  12.  
  13.  
  14.  ******************************************************************************/
  15.  
  16. #pragma once
  17.  
  18. #include "CStyleText.h"
  19.  
  20. enum {
  21.  
  22.     kNoBorder =    FALSE,
  23.     kDrawBorder
  24.  
  25. };
  26.  
  27. CLASS CStringArray;
  28.  
  29. class CHyperText : public CStyleText 
  30. {
  31. public:
  32.                 /*  Data Members  */
  33.     long            clickCmd;            // Command to issue when clicked
  34.     
  35.     CStringArray    *itsHyperList;        // CStringArray which holds a list of
  36.                                         // hypertext keywords in memory.
  37.                                         // Usually initialized from an STR#
  38.                                         // resource via SetTextRes()
  39.                                         
  40.     Boolean            ownsHyperList;        // used for proper disposal
  41.     
  42.     short            oldH, oldV;            // used for moving the pane offscreen
  43.     
  44.     short            numFlashes;        // number of times to flash the hyperword
  45.     
  46.     CursHandle        hyperCursor;        // used to show the user that the mouse
  47.                                         // is over a hyperword
  48.                                         
  49.     Str255            lastHyperword;        // the string of the most recent hyperhit
  50.  
  51.     void            IHyperText(CView *anEnclosure, CBureaucrat *aSupervisor,
  52.                             short aWidth, short aHeight,
  53.                             short aHEncl, short aVEncl,
  54.                             SizingOption aHSizing, SizingOption aVSizing,
  55.                             short aLineWidth, Boolean hasBorder);
  56.     
  57.     virtual void     IViewTemp(CView *anEnclosure, CBureaucrat *aSupervisor,
  58.                             Ptr viewData);
  59.     virtual void    Dispose( void);
  60.     virtual void    AdjustCursor(Point where,RgnHandle    mouseRgn);
  61.     virtual Boolean    CursorOverHyperword(LongPt where);
  62.     virtual void    DoClick(Point hitPt, short modifierKeys, long when);
  63.     virtual void     DoKeyDown( char theChar, Byte keyCode, EventRecord *macEvent);
  64.  
  65.     virtual void     SetTextRes(short resourceID);
  66.     virtual void    Stylize(void);
  67.  
  68.     virtual void    SetFlashes(short aFlashTimes);
  69.     
  70.     virtual void    SetClickCmd(long aClickCmd);
  71.     virtual long    GetClickCmd( void);
  72.     virtual void     SetListRes(short resourceID);
  73.     virtual void     SetList(CStringArray *aStrList);
  74.     virtual CStringArray* GetList(void);
  75.  
  76.     virtual void     MoveOffScreen( void);
  77.     virtual void     MoveOnScreen( void);
  78.  
  79. protected:
  80.                         
  81.     void            IHyperTextX( void);
  82.     virtual void     MakeBorder( void);
  83.  
  84. };
  85.  
  86. enum
  87. {
  88.             /* indicates the text has changed in some way         */
  89.             /* info parameter is pointer (short*) to pane ID    */
  90.             
  91.     hyperTextChanged = textLastChange + 1,
  92.     
  93.     hyperTextLastChange = hyperTextChanged
  94. };
  95.  
  96. typedef struct tHyperTextTemp
  97. {
  98.     tAbstractTextTemp absTextTmp;
  99.     short        TEXT_Res_ID;
  100.     short        STRlist_Res_ID;    
  101.     short        makeBorder;    
  102. } tHyperTextTemp, *tHyperTextTempP;